#!/bin/bash

set -e -u

ROOT=$(cd $(dirname $0)/.. && pwd)

DEVDIR=/tmp/concourse-dev
KEYSDIR=$DEVDIR/keys

export GOPATH=$ROOT
export PATH=$ROOT/bin:$PATH

go install github.com/concourse/tsa/cmd/tsa

tsa \
  --atc-url http://127.0.0.1:8080 \
  --host-key $KEYSDIR/web/host_key \
  --peer-ip 127.0.0.1 \
  --authorized-keys $KEYSDIR/web/authorized_worker_keys \
  --session-signing-key $KEYSDIR/web/session_signing_key \
  "$@"
